﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Job.Entity;
using Job.Logic.BaseContent;
using Job.Web.Framework;

namespace Job.Web.userControls.Public
{
    public partial class Header : BaseCtrl
    {
        int subjectId = myR["subjectid"].IntValue;

        int contentId = myR["contentid"].IntValue;

        int categoryId = myR["categoryid"].IntValue;

        public int GetCategoryId()
        {
            if (categoryId > 0) return categoryId;
            if (subjectId > 0)
            {
                BaseInfo info = WebCommon.GetSubjectInfo(subjectId);
                return info.CatagoryId;
            }

            if (contentId > 0)
            {
                JobBaseContent content = new BaseContentLogic().GetContentByContentId(contentId);
                BaseInfo info = WebCommon.GetSubjectInfo(content.SubjectId.Value);
                return info.CatagoryId;
            }
            return 0;

        }



    }
}